<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>

<script>
  function onSubmit(op,userId){

	     document.getElementById('user_id').value=userId;

          var form = document.getElementById('userForm');
          form.action="user/"+op;
          form.submit();
      }
  function onSubmitDelete(op,userId){

	  	 document.getElementById('user_id').value=userId;

	  	 if (false === confirm('削除しますか？') )return;
	  	 var form = document.getElementById('userForm');
         form.action="user/"+op;
         form.submit();
     }
  </script>

</head>

@extends('layouts.admin_common') @section('content')

<div class="breadcrumbs_container">
	{{Breadcrumbs::render('admin.user_list') }}</div>
<div class="system_tab_line"></div>

<body>
	<div id="outDiv">
		<table class="table table-condensed">
			<tr>
				<td>ユーザ名</td>
				<td>ユーザカナ</td>
				<td>ログインID</td>
				<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
			</tr>
			<tr>@foreach ($userInfos as $userInfo)


			<tr>
				<td>{{$userInfo->user_name}}</td>
				<td>{{$userInfo->user_kana}}</td>
				<td>{{$userInfo->login_id}}</td>
				<td><input type="button" value="修正"
					class="btn btn-primary button_normal"
					onclick="onSubmit('create','{{$userInfo->user_id}}')" /><input
					type="button" value="削除" class="btn btn-primary button_normal"
					onclick="onSubmitDelete('delete','{{$userInfo->user_id}}')" /></td>
			</tr>
			@endforeach
		</table>
		<form class="form-inline" id="userForm" method="post">
			<table border="0" cellspacing="0" style="width: 1300px;">
				<tr>
					<td align="right"><input type="button" value="新規"
						class="pure-button pure-button-primary button_normal"
						onclick="onSubmit('create','')" /></td>

			</table>
			<div>@if(isset($success)) {{$success}} @endif</div>
			<div>@if(isset($error)) {{$error}} @endif</div>
			<input type="hidden" id="user_id" name="user_id"> <input
				type="hidden" name="_token" value="{{csrf_token()}}">
		</form>
	</div>
</body>
</html>
@endsection
